/**
 * 
 */
package wt.stock.data.util;

import java.util.List;

import wt.stock.data.DayQuoteData;

/**
 * @author Wen Tao
 *
 */
public class DataUtil {
	public int calcMA(List<DayQuoteData> list, int index, int n){
		if(index<n-1) return -1;
		int total = 0;
		for(int i=0;i<n;i++){
			total += list.get(index-i).getClose();
		}
		return total/n;
	}
}
